package com.ccsc.auth.service.impl;

import com.ccsc.auth.service.AuthService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Service;

/**
 * Created by XingWen on 2017/2/28.
 */
@Service
public class AuthServiceImpl implements AuthService {
    @Override
    public Boolean checkAuthority(Integer userId, String classUrl, String methodUrl) throws Exception {
        Subject subject = SecurityUtils.getSubject();
        Session session = subject.getSession(false);
        if(session!=null){
            return true;
        }
        else {
            return false;
        }
    }
}
